home *** CD-ROM | disk | FTP | other *** search
/ Freelog 125 / Freelog_MarsAvril2015_No125.iso / Musique / Quod Libet / quodlibet-3.3.0-installer.exe / bin / quodlibet / plugins / gui.pyc (.txt) < prev    next >
Python Compiled Bytecode  |  2014-12-31  |  2KB  |  39 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.7)
  3.  
  4. from quodlibet import config
  5. from gi.repository import Gtk
  6.  
  7. class MenuItemPlugin(Gtk.ImageMenuItem):
  8.     '''
  9.     A base plugin that appears in a menu, typically
  10.  
  11.  
  12.     During plugin callbacks, `self.plugin_window` will be
  13.     available. This is the `Gtk.Window` that the plugin was invoked from.
  14.     It provides access to two important widgets, `self.plugin_window.browser`
  15.     and `self.plugin_window.songlist`.
  16.     '''
  17.     MAX_INVOCATIONS = config.getint('plugins', 'default_max_invocations', 30)
  18.     
  19.     def __init__(self, window):
  20.         super(Gtk.ImageMenuItem, self).__init__(label = self.PLUGIN_NAME)
  21.         self.plugin_window = window
  22.         self._MenuItemPlugin__set_icon()
  23.         self._MenuItemPlugin__initialized = True
  24.  
  25.     
  26.     def __set_icon(self):
  27.         '''Sets the GTK icon for this plugin item'''
  28.         icon = getattr(self, 'PLUGIN_ICON', Gtk.STOCK_EXECUTE)
  29.         image = Gtk.Image.new_from_stock(icon, Gtk.IconSize.MENU) if Gtk.stock_lookup(icon) else Gtk.Image.new_from_icon_name(icon, Gtk.IconSize.MENU)
  30.         self.set_always_show_image(True)
  31.         self.set_image(image)
  32.  
  33.     
  34.     def initialized(self):
  35.         return self._MenuItemPlugin__initialized
  36.  
  37.     initialized = property(initialized)
  38.  
  39.